def hash1(key,n):
    return key%n

def hash2(key,prime):
    return prime-key%prime

def hash(key,TableSize,prime,i):
    result1=hash1(key,TableSize)
    result2=i*hash2(key,prime)
    result=(result1+result2)%TableSize
    return result
